
// 不过滤
const getSummaryByContent = (className,maxLength) => {
    maxLength = maxLength || 500;
    let showDom = document.querySelector("."+className);
    // 提取纯文本内容
    let textContent = showDom.innerText;
    // 生成摘要
    return textContent.substring(0, maxLength) + (textContent.length > maxLength ? "..." : "");
}

let description = getSummaryByContent("post-body",200);
console.info(description);

